#pragma once

#define SPDLOG_HEADER_ONLY
#define FMT_HEADER_ONLY
#include <spdlog/spdlog.h>
#include <spdlog/async.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include "spdlog/sinks/rotating_file_sink.h"

class Log
{
public:
    Log();

    void info(const char* s);
    void debug(const char* s);
    void error(const char* s);
    void warn(const char* s);

    void set_file(const char* logger_name, int max_files, long long max_file_size);
    void set_pattern(const char* pattern);
    void set_level(int logger_level);

    const char* get_version();

private:
    int         level_;
    std::string pattern_;
};

void log_init();

Log* newLog();